package ncov.service.impl;

import ncov.dao.DepartmentDao;
import ncov.model.Department;
import ncov.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author WuChangJian
 * @date 2020/6/4 20:35
 */
@Service
@Transactional
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    DepartmentDao departmentDao;


    @Override
    public List<Department> getDepartment(Department department) {
        return departmentDao.queryAll(department);
    }

    @Override
    public Department getDeptById(Integer deptId) {
        if (departmentDao != null) {
            return departmentDao.queryById(deptId);
        }
        return null;
    }
}
